export default {
  'post /api/house/search': (req, res) => {
    setTimeout(() => {
      let data;
      if(req.body.pageNum < 4){
        data =  [
          {
            id: 1,
            img: 'https://cdn.pixabay.com/photo/2014/08/12/00/01/santorini-416136__340.jpg',
            title: '东城民宿',
            info: '东城区交通方便',
            price: '100'
          },
          {
            id: 2,
            img: 'https://cdn.pixabay.com/photo/2014/05/08/15/37/coast-340348__340.jpg',
            title: '西城民宿',
            info: '西城区山水怡情',
            price: '120'
          },
          {
            id: 3,
            img: 'https://cdn.pixabay.com/photo/2019/11/08/18/16/matera-4612016__340.jpg',
            title: '新区民宿',
            info: '新区民宿位置优越',
            price: '200'
          },
          {
            id: 4,
            img: 'https://cdn.pixabay.com/photo/2016/02/27/21/01/ancient-1226277__340.jpg',
            title: '老城民宿',
            info: '老城区风景秀美',
            price: '220'
          },
          {
            id: 5,
            img: 'https://cdn.pixabay.com/photo/2014/08/12/00/01/santorini-416136__340.jpg',
            title: '东城民宿',
            info: '东城区交通方便',
            price: '100'
          },
          {
            id: 6,
            img: 'https://cdn.pixabay.com/photo/2014/05/08/15/37/coast-340348__340.jpg',
            title: '西城民宿',
            info: '西城区山水怡情',
            price: '120'
          },
          {
            id: 7,
            img: 'https://cdn.pixabay.com/photo/2019/11/08/18/16/matera-4612016__340.jpg',
            title: '新区民宿',
            info: '新区民宿位置优越',
            price: '200'
          },
          {
            id: 8,
            img: 'https://cdn.pixabay.com/photo/2016/02/27/21/01/ancient-1226277__340.jpg',
            title: '老城民宿',
            info: '老城区风景秀美',
            price: '220'
          },
        ]
      }else {
        data = []
      }
      res.json({
        status: 200,
        data
      });
    }, 500);
    
  },
  'post /api/house/detail': (req, res) => {
    res.json({
      status: 200,
      data: {
        id: 8,
        banner: [
          'https://cdn.pixabay.com/photo/2017/06/16/11/43/santorini-2408868__340.jpg',
          'https://cdn.pixabay.com/photo/2017/09/02/19/26/norway-2708286__340.jpg',
          'https://cdn.pixabay.com/photo/2015/06/24/16/46/greece-820415__340.jpg',
        ],
        info: {
          title: '老城民宿',
          msg: '老城区风景秀美',
          price: '220',
          publishTime: 1595238771000,
          startTime: 1595238771000,
          endTime: 1597917171000,
        }
      }
    });
  },
  'post /api/comments/lists': (req, res) => {
    setTimeout(() => {
      let data;
      if (req.body.pageNum < 4) {
        data = [
          {
            id: 1,
            avatar: 'https://images.pexels.com/photos/4226183/pexels-photo-4226183.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500',
            username: 'user',
            createTime: 1595238771000,
            info: '房屋很满意'
          },
          {
            id: 2,
            avatar: 'https://images.pexels.com/photos/6569370/pexels-photo-6569370.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500',
            username: 'user',
            createTime: 1595238771000,
            info: '空气清新'
          },
          {
            id: 3,
            avatar: 'https://images.pexels.com/photos/6199940/pexels-photo-6199940.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500',
            username: 'user',
            createTime: 1595238771000,
            info: '态度温和'
          },
          {
            id: 4,
            avatar: 'https://images.pexels.com/photos/2976370/pexels-photo-2976370.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500',
            username: 'user',
            createTime: 1595238771000,
            info: '早餐味道美'
          },
          {
            id: 5,
            avatar: 'https://images.pexels.com/photos/4014919/pexels-photo-4014919.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500',
            username: 'user',
            createTime: 1595238771000,
            info: '态度温和'
          },
          {
            id: 6,
            avatar: 'https://images.pexels.com/photos/3013979/pexels-photo-3013979.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500',
            username: 'user',
            createTime: 1595238771000,
            info: '早餐味道美'
          },
          {
            id: 7,
            avatar: 'https://images.pexels.com/photos/5942720/pexels-photo-5942720.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500',
            username: 'user',
            createTime: 1595238771000,
            info: '态度温和'
          },
          {
            id: 8,
            avatar: 'https://images.pexels.com/photos/3785642/pexels-photo-3785642.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500',
            username: 'user',
            createTime: 1595238771000,
            info: '早餐味道美'
          },
        ]
      } else {
        data = [];
      }
      res.json({
        status: 200,
        data
      });
    }, 100);
  },
  'post /api/comments/add': (req, res) => {
    res.json({
      status: 200,
      data: 'ok'
    });
  }
};